import type { BasicConfigOption } from '@/views/tools/nginx/nginx-info.ts'

const proxyCommonOptions: BasicConfigOption[] = [
  {code: 'proxy_bind', name: 'proxy_bind'},
  {code: 'proxy_buffer_size', name: 'proxy_buffer_size'},
  {code: 'proxy_connect_timeout', name: 'proxy_connect_timeout'},
  {code: 'proxy_download_rate', name: 'proxy_download_rate'},
  {code: 'proxy_half_close', name: 'proxy_half_close'},
  {code: 'proxy_next_upstream', name: 'proxy_next_upstream'},
  {code: 'proxy_next_upstream_timeout', name: 'proxy_next_upstream_timeout'},
  {code: 'proxy_next_upstream_tries', name: 'proxy_next_upstream_tries'},
  {code: 'proxy_pass', name: 'proxy_pass'},
  {code: 'proxy_protocol', name: 'proxy_protocol'},
  {code: 'proxy_requests', name: 'proxy_requests'},
  {code: 'proxy_responses', name: 'proxy_responses'},
  {code: 'proxy_session_drop', name: 'proxy_session_drop'},
  {code: 'proxy_socket_keepalive', name: 'proxy_socket_keepalive'},
  {code: 'proxy_ssl', name: 'proxy_ssl'},
  {code: 'proxy_ssl_certificate', name: 'proxy_ssl_certificate'},
  {code: 'proxy_ssl_certificate_cache', name: 'proxy_ssl_certificate_cache'},
  {code: 'proxy_ssl_certificate_key', name: 'proxy_ssl_certificate_key'},
  {code: 'proxy_ssl_ciphers', name: 'proxy_ssl_ciphers'},
  {code: 'proxy_ssl_conf_command', name: 'proxy_ssl_conf_command'},
  {code: 'proxy_ssl_crl', name: 'proxy_ssl_crl'},
  {code: 'proxy_ssl_key_log', name: 'proxy_ssl_key_log'},
  {code: 'proxy_ssl_name', name: 'proxy_ssl_name'},
  {code: 'proxy_ssl_password_file', name: 'proxy_ssl_password_file'},
  {code: 'proxy_ssl_protocols', name: 'proxy_ssl_protocols'},
  {code: 'proxy_ssl_server_name', name: 'proxy_ssl_server_name'},
  {code: 'proxy_ssl_session_reuse', name: 'proxy_ssl_session_reuse'},
  {code: 'proxy_ssl_trusted_certificate', name: 'proxy_ssl_trusted_certificate'},
  {code: 'proxy_ssl_verify', name: 'proxy_ssl_verify'},
  {code: 'proxy_ssl_verify_depth', name: 'proxy_ssl_verify_depth'},
  {code: 'proxy_timeout', name: 'proxy_timeout'},
  {code: 'proxy_upload_rate', name: 'proxy_upload_rate'},
]
export const streamBasicOptions : BasicConfigOption[] = [
  ...proxyCommonOptions
]
export const streamServerBasicOptions : BasicConfigOption[] = [
  ...proxyCommonOptions,
  {code: 'listen', name: 'listen'},
  {code: 'preread_buffer_size', name: 'preread_buffer_size'},
  {code: 'preread_buffer_size', name: 'preread_buffer_size'},
  {code: 'preread_timeout', name: 'preread_timeout'},
  {code: 'resolver', name: 'resolver'},
  {code: 'resolver_timeout', name: 'resolver_timeout'},
  {code: 'proxy_protocol_timeout', name: 'proxy_protocol_timeout'},
  {code: 'server_name', name: 'server_name'},
  {code: 'server_names_hash_bucket_size', name: 'server_names_hash_bucket_size'},
  {code: 'server_names_hash_max_size', name: 'server_names_hash_max_size'},
]
export const streamUpstreamBasicOptions : BasicConfigOption[] = [
  { code: 'upstream', name: 'upstream'},
  { code: 'server', name: 'server'},
  { code: 'zone', name: 'zone'},
  { code: 'state', name: 'state'},
  { code: 'hash', name: 'hash'},
  { code: 'least_conn', name: 'least_conn'},
  { code: 'least_time', name: 'least_time'},
  { code: 'random', name: 'random'},
  { code: 'resolver', name: 'resolver'},
  { code: 'resolver_timeout', name: 'resolver_timeout'},
]
